package com.jumi.microservice.service;

import com.jumi.microservice.common.base.dto.ResponseResult;
import com.jumi.microservice.dto.ExpressResponse;
import com.jumi.microservice.dto.admin.*;
import com.jumi.microservice.dto.apiService.OrderGoodsResponse;
import com.jumi.microservice.dto.apiService.OrderInformationResponse;
import com.jumi.microservice.dto.order.*;
import com.jumi.microservice.dto.serviceDto.*;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author by mazhao
 * @Classname IAutoSpiltService
 * @Description
 * @Date 2020/8/8 15:11
 */

public interface IOrderService {
    /**
     * 根据供货商id查询订单id
     */
    List<Integer> getOrderBySupplierId(int supplierId);

    /**
     * 根据购买人id查询订单id
     */
    List<Integer> getOrderByBuyerId(int buyerIdArr);

    /**
     * 订单详情
     */
    OrderGoodsEntityResponse getOrderGoodsDetails(OrderIdGoodsIdRequest orderIdGoodsIdRequest);

    /**
     * 根据订单id获取订单编号
     */
    List<OrderInformationResponse> getOrderInformation(int[] orderIdArr);

    /**
     * 根据订单goodsId获取goodsName订单里记录的那个
     */
    List<OrderGoodsResponse> getGoodsIdAndGoodsName(int[] goodsIdArr);

    /**
     * 发货
     */
    Boolean deliverGoods(DeliverGoodsRequest request);

    /**
     * 修改订单状态
     *
     * @param orderId
     * @param orderStatus
     * @return
     */
    Boolean updateOrderStatus(int orderId, byte orderStatus);

    /**
     * 订单取消之后取消包裹
     *
     * @param orderId
     * @return
     */
    Boolean cancelLogistics(Integer orderId);

    /**
     * spu销量
     *
     * @param salesRequest
     * @return
     */
    SalesResponse getSpuSalesVolume(SalesRequest salesRequest);

    /**
     * 统计某用户自购省
     *
     * @param uids
     * @return
     */
    List<Map<String, Object>> selfSave(String uids);

    ResponseResult<InvoiceGoodsResponse> getInvoiceGoodsResponse(String orderNo);

    /**
     * 统计各个状态的订单数量
     *
     * @param request
     * @return
     */
    Integer countUserOrder(UserOrderRequest request);

    /**
     * 查询订单日志
     *
     * @param orderSn
     * @return
     */
    List<OrderLogResponse> getOrderLogList(String orderSn);

    /**
     * 获取用户订单详情列表
     *
     * @param request
     * @return
     */
    @Deprecated
    List<OrderResponse> getOrderInfo(OrderInfoRequest request);

    /**
     * 获取用户未评价订单数量
     *
     * @param uid
     * @return
     */
    Integer waitCommentCount(Long uid);

    /**
     * 获取用户活动商品近期购买量
     *
     * @param requestList
     * @return
     */
    List<ActivityUserSalesRequest> getSpuSalesVolumeActivity(List<ActivityUserSalesRequest> requestList);

    OrderDetailsResponse getOrderDetails(OrderDetailsRequest orderDetailsRequest) throws Exception;

    List<Integer> getOrderByRealWarehouseId(int realWarehouseId);

    List<Integer> getOrderByBeginTime(String beginTime);

    List<Integer> getOrderByEndTime(String endTime);

    List<Integer> getOrderByGoodsName(String goodsName);

    List<Integer> getOrderByPhone(String phone);

    Integer getOrderStatus(int orderId);

    OrderStatusAfterSealResponse getStatusAfterSeal(int orderId, int goodsId);

    Boolean updateAfterSealStatus(UpdateAfterSealStatusRequest updateAfterSealStatusRequest);

    Boolean updateReturnInfo(UpdateReturnInfoRequest updateReturnInfoRequest);

    Boolean updateRefundInfo(UpdateRefundInfoRequest updateRefundInfoRequest);

    Boolean updateRefundGoodsInfo(UpdateRefundGoodsInfoRequest updateRefundGoodsInfoRequest);

    Integer realSendAmount(int orderId, int goodsId);

    List<Integer> getOrderIdByCreateTime(Date payTime, Date payEndTime);

    OrderGoodsServiceDetailsResponse findOrderGoodsDetails(OrderGoodsServiceDetailsRequest request);

    Date getConfirmTime(int orderId);

    Boolean isExistAfterSale(int orderId);

    Boolean cancelLogisticsAndGoods(Integer orderId, Integer goodsId);

    Boolean orderGoodsStatus(int orderId);

    ExpressResponse autoIdentify(String logisticsNo);

    Boolean updateInvoiceId(String orderNo, Integer invoiceId);

    /**
     * 商品出库中弹窗提示接口
     *
     * @param orderId
     * @param skuIdStr
     * @return
     */
    Boolean isDelivery(Integer orderId, String skuIdStr);

    /**
     * 根据支付单号统计多个订单的总支付金额
     * 一个支付单号--对应多个订单
     *
     * @param payNo
     * @return
     */
    BigDecimal getPayTotalAmount(String payNo);
}
